import QQMapWX from '../libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min'

const QQMap = new QQMapWX({
  key: 'OCVBZ-6BM3B-AMPUJ-NJZOX-7KIP3-VDBSJ',
})

QQMap.p = {
  search(option){
    return new Promise(resolve =>
      QQMap.search({
        ...option,
        success: resolve
      })
    )},
  reverseGeocoder(option){
    return new Promise(resolve =>
      QQMap.reverseGeocoder({
        ...option,
        success: resolve
      })
    )
  }
}

export default QQMap